package com.team7.controller;

import com.team7.service.CourseListService;
import com.team7.service.CourseManageService;
import com.team7.vo.CommonResult;
import com.team7.vo.FontCourseVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @program: team7-object
 * @description:
 * @author: 田宏洋
 * @create: 2021-10-25 21:16
 **/
@RestController
@RequestMapping("/core/course")
public class WebCourseController {
    @Resource
    private CourseListService courseListService;
    @Resource
    private CourseManageService courseManageService;

    @PostMapping("/fontFindCourse/{page}/{limit}")
    @ApiOperation("前台分页查询课程列表")
    public CommonResult fontFindCourse(@PathVariable("page") Integer page, @PathVariable("limit") Integer limit, @RequestBody FontCourseVo courseVo){
        CommonResult courseByPage = courseListService.findFontCourseByPage(page, limit, courseVo);
        return courseByPage;
    }
    @PostMapping("/getAllMenu")
    @ApiOperation("课程中心的菜单栏")
    public CommonResult getAllMenu(){
        CommonResult allMenu = courseManageService.getAllMenu();
        return allMenu;
    }
}
